import request from "@/router/axios"

export const removeImg = (attachId) => {
  return request({
    url: '/api/uic-system/attachment/remove',
    method: 'post',
    params: {
      ids: attachId
    }
  })
}

export const getImgs = (attachIds) => {
  const ids = attachIds.join(',')
  return request({
    url: '/api/uic-system/attachment/listByIdsAndFileType',
    method: 'get',
    params: {
      ids
    }
  })
}

export function downFile(data) {
  return request({
    url: data.filePath,
    method: 'get',
    responseType: 'blob'
  })
}

export const getRefImgs = (attachRelId, fileType) => {
  return request({
    url: '/api/uic-system/attachment/list',
    method: 'get',
    params: {
      fileType,
      attachRelId,
      size: 100
    }
  })
}

export const getRefFile = (attachRelId, fileType) => {
  return request({
    url: '/api/uic-system/attachment/list',
    method: 'get',
    params: {
      fileType,
      attachRelId,
      size: 100
    }
  })
}
